﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nova.Parsing.GoldParser.Semantic;

namespace Nova.Parsing.Tokens
{
    [Terminal("warn")]
    [Terminal("error")]
    [Terminal("info")]
    [Terminal("notice")]
    public sealed class LogLevelToken : NovaToken
    {
        private NovaLogLevel m_LogLevel;

        public LogLevelToken(string level)
        {
            switch (level)
            {
                case "warn": m_LogLevel = NovaLogLevel.Warning; break;
                case "error": m_LogLevel = NovaLogLevel.Error; break;
                case "info": m_LogLevel = NovaLogLevel.Information; break;
                case "notice": m_LogLevel = NovaLogLevel.Notice; break;
                default: m_LogLevel = NovaLogLevel.Unknown; break;
            }
        }

        public NovaLogLevel LogLevel
        {
            get { return m_LogLevel; }
        }
    }
}
